const mongoose = require('mongoose');
require('mongoose-long')(mongoose);
let schemaTypes = mongoose.Schema.Types;

//省市区schema
let dicPcdSchema = new mongoose.Schema({
    _id: {
        type: schemaTypes.ObjectId,
        require: true // 不可为空约束
    },
    //名称
    value: {
        type: String,
        require: true
    },
    //代码
    label: {
        type: String,
        require: true
    },
    //子节点
    label: {
        type: Array,
        require: true
    }
}, {
    versionKey: false
});

//省市区模型
let DicPcdModel = mongoose.model('DicPcdModel', dicPcdSchema, 'dic_pcd');
module.exports = DicPcdModel;